package com.example.shop.ov;


import com.example.shop.shops.domain.User;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.NotBlank;
import java.util.Date;

@Data
@AllArgsConstructor
@NoArgsConstructor
public class UserDto {

    @NotBlank(message = "邮箱不能为空")
    private String email;
    @NotBlank(message = "不能为空")
    private String phone;
    @NotBlank(message = "不能为空")
    private String smsCode;
    @NotBlank(message = "不能为空")
    private String password;
    @NotBlank(message = "不能为空")
    private String passwordRepeat;


    public static User getUser() {
        return User.builder()
                .age(18)
                .id(null)
                .createtime(new Date())
                .state(0)
                .build();
    }
}
